<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../../static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../ht-css/Project.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="../../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../ht-css/style-q.css" />
     <link rel="stylesheet" type="text/css" href="../../ht-css/custom.css" />
       <style>
           label.error{position:relative;right: 0;top:0}
           #beijing{
               z-index:1;
               width:100%;
               height:100%;
               position: absolute;
               left:0;
               top:0;
               background-color: #000;
               opacity:0.3;
               display: none;
           }
           #myLoading{
               position: fixed;
               top: 50%;
               left: 50%;
               margin-top:-62px;
               transform: translateX(-50%) translateY(-50%);
               z-index:2;
               display: none;
           }
       </style>
    <title>发券创建</title>
</head>
<body>

<nav class="breadcrumb">电子券管理 <span class="c-gray en">&gt;</span>发券创建<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<section class="page-container">
  <form class="ml-20 mr-20" id="form-member-add"  method="post">
      <div>
        <div class="bg-1 bk-gray pd-20 mb-20">     
            <div class="row cl pd-10">
                 <div class="col-md-3"  style="margin-left:55px;">
                    <label class="form-label f-l">发券编号：</label>
                    <div  class="formControls col-md-7">----</div>                    
                </div>
                <div class="col-md-3">
                    <label class="form-label f-l"><span class="c-red c-must">*</span>名称：</label>
                    <div  class="formControls col-md-7"><input type="text" class="input-text radius"
                                                               name="sendCouponName" id="sendCouponName"
                                                               placeholder="" maxlength="50"></div>
                </div>
                <div class="col-md-2">
                    <label class="form-label f-l">发券人：</label>
                    <div  class="formControls col-md-7" name="sendCouponUser" id="sendCouponUser"></div>
                </div>
                <div class="col-md-3">
                    <label class="form-label f-l">发券部门：</label>
                    <div  class="formControls col-md-7" name="sendCouponDept" id="sendCouponDept"></div>
                </div>
            </div>
            <div class="row cl pd-10">
                 <div class="">
                    <label class="form-label f-l wd_140"><span class="c-red c-must">*</span>发券原因：</label>
                    <div  class="formControls col-md-6">
                      <span class="select-box radius" style="width:25%">
                        <select class="select" size="1" name="sendReasonDutyDept" id="sendReasonDutyDept"
                                onchange="sendDeptChange(value)">
                            <option value="" selected>选择责任部门</option>
                            <option value="1">商品问题</option>
                            <option value="2">仓储/物流问题</option>
                            <option value="3">财务问题</option>
                            <option value="4">网站运营问题</option>
                            <option value="5">服务体验问题</option>
                            <option value="6">运费问题</option>
                            <option value="7">技术问题</option>
                      </select>

                      </select>
                      </span>
                          <span class="select-box radius" style="width:25%">
                             <select class="select" size="1" name="sendCouponReason" id="sendCouponReason" >
                                <option value="" selected>选择具体原因</option><option class="options hide"  value="11">质量问题</option><option class="options hide" value="12">无货问题</option><option class="options hide" value="21">配送延迟</option><option class="options hide" value="22">状态维护错误</option><option class="options hide" value="23">私自拒收</option><option class="options hide" value="24">包装/商品破损</option><option class="options hide" value="25">违规收费</option><option class="options hide" value="26">服务态度差</option><option class="options hide" value="27">错漏发</option><option class="options hide" value="31">退款时效慢</option><option class="options hide" value="32">开票信息有误</option><option class="options hide" value="33">退款金额有误</option><option class="options hide" value="34">开具发票时间有误</option><option class="options hide" value="41">商品参数错误</option> <option class="options hide" value="42">价格错误</option> <option class="options hide" value="43">活动与实际不符</option> <option class="options hide" value="44">活动优惠券补发</option> <option class="options hide" value="45">活动优惠券发放</option><option class="options hide" value="51">特殊售后问题</option> <option class="options hide" value="52">提升客户体验</option> <option class="options hide" value="53">承诺错误</option> <option class="options hide" value="54">售后时间长</option><option class="options hide" value="61">售后运费补偿</option> <option class="options hide" value="62">错发运费补偿</option><option class="options hide" value="71">订单未流转</option> <option class="options hide" value="72">活动未绑定优惠品、赠品</option> <option class="options hide" value="73">系统自动取消</option> <option class="options hide" value="74">页面缓存问题</option>
                             </select>
                          </span>
                    </div>                   
                </div>
            </div>
            <div class="row cl pd-10">                 
                 <div class="clearfix col-md-12">
                      <label class="f-l pt-5 wd_140" style="width: 115px">描述：</label>
                      <div class="formControls col-md-5">
                          <textarea name="description" id="description" class="textarea" title="" maxlength="200"></textarea></div>
                  </div>            
            </div>
            <div class="row cl pd-10">
                <label class="form-label f-l ml-20">发券方式：</label>
                <select id="sendCouponType" style="width:13%" class="select f-l" size="1"
                        onchange="changeSendType()">
                    <option value="1">手动发券</option>
                    <option value="2"selected>自动发券</option>
                    <option value="3">客户领取</option>
                    <option value="4">抽奖发送</option>
                </select>
            </div>
            <div class="row cl pd-10" id="twoOrThree" style="display: none">
                <label class="form-label f-l text-r w-60 lh-26" style="width: 80px;"><span class="c-red c-must">*</span>发放客户：</label>
                <div class="formControls f-l ml-10 lh-26">
                    <label id="customerTypef0"><input type="checkbox" value="20,30"  name="customerType0" id="customerType" onclick="check()"/>全部&nbsp;&nbsp;</label>
                    <label><input id="customerTypes1" type="checkbox" value="20"  name="customerType"/>普通客户&nbsp;&nbsp;</label>
                    <label><input id="customerTypes2" type="checkbox" value="30"  name="customerType"/>认证客户&nbsp;&nbsp;</label>
                    <!--<label id="customerTypef1"><input type="checkbox" value="11"  name="customerType"/>签约客户(非分销)&nbsp;&nbsp;</label>
                    <label id="customerTypef2"><input type="checkbox" value="12"  name="customerType"/>签约客户(分销)&nbsp;&nbsp;</label>-->
                </div>
            </div>

            <div class="row cl pd-10" id="two" style="display: none">
                <label class="form-label f-l text-r w-60 lh-26" style="width: 80px;"><span class="c-red c-must">*</span>发放条件：</label>
                <select id="sendCondition" style="width:13%" class="select f-l" size="1"
                        onchange="changeSendCondition()">
                    <option value="" selected>请选择发放条件</option>
                    <option value="1">新注册客户</option>
                    <option value="2">满足订单金额条件</option>
                    <option value="3" id="kehu">客户中奖后自动发放</option>
                    <option value="4">按照客户的价格类型</option>
                </select>
            </div>
            <div class="clearfix mb-15 "  id="pricetype" style="display: none">
                <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>适用价格类型：</label>
                <div class="check-box f-l mt-5" style="display: none" id="unlimited">
                    <input type="radio" id="bos--" name="priceType" value="0">
                    <label  class="" >不限</label>
                </div>
                <div class="check-box f-l mt-5">
                    <input type="radio" id="bos" name="priceType" value="20">
                    <label  class="" >现金价</label>
                </div>
                <div class="check-box f-l mt-5">
                    <input type="radio" id="bos-" name="priceType" value="10">
                    <label  class="" >售价</label>
                </div>
            </div>

            <div class="row cl pd-10" id="two-1" style="padding-left: 65px;display: none">
                <label class="form-label f-l text-r w-60 lh-26 pl-15" style="width: 100px">订单金额满：</label>
                <div class="formControls col-md-2"><input type="text" class="input-text radius"
                                                          name="orderAmount" id="orderAmount"  placeholder="" maxlength="50" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}"></div>
            </div>
            <div class="row cl pd-10" id="two-2" style="padding-left: 65px;display: none">
                <label class="form-label f-l text-r w-60 lh-26 pl-15" style="width: 100px">适用仓：</label>
                <div class="formControls f-l ml-10 lh-26">
                    <label><input type="checkbox" value=""  name="warehouse0" id="wareHouse" onclick="warehouseCheck()"/>全部&nbsp;&nbsp;</label>
                    <span id="cartwareHous"> </span>
                </div>
            </div>
            <div class="row cl pd-10" id="two-3" style="padding-left: 65px;display: none">
                <label class="form-label f-l text-r w-60 lh-26 pl-15" style="width: 100px">适用支付方式：</label>
                <div class="formControls f-l ml-10 lh-26">
                    <label><input type="checkbox" value="1001"  name="payType"/>在线支付&nbsp;&nbsp;</label>
                    <label><input type="checkbox" value="1301"  name="payType"/>银行转账&nbsp;&nbsp;</label>
                    <label><input type="checkbox" value="1401"  name="payType"/>银行汇票&nbsp;&nbsp;</label>
                    <label><input type="checkbox" value="1101"  name="payType"/>货到付款&nbsp;&nbsp;</label>
                    <label><input type="checkbox" value="1201"  name="payType"/>账期支付&nbsp;&nbsp;</label>
                    <label><input type="checkbox" value="1701"  name="payType"/>门店付款&nbsp;&nbsp;</label>
                </div>
            </div>
            <div class="row cl pd-10" id="time" style="display: none">
                <label class="form-label f-l label-4" style="width: 80px;padding: 5px 10px 0;"><span class="c-red c-must">*</span>生效日期：</label>
                <div class="f-l">
                    <!--<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'logmax\')||\'%y-%M-%d\'}' })" id="logmin" class="input-text Wdate radius f-l" style="width:120px;" placeholder="请选择时间">-->
                    <input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'logmax\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" id="logmin" name="logmin" class="input-text Wdate radius f-l" style="width:130px;" placeholder="请选择时间" autocomplete="off">
                    <span class="pd-5">~</span>
                    <input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'logmin\')}',dateFmt:'yyyy-MM-dd HH:mm:ss' })" id="logmax" class="input-text Wdate radius" style="width:130px;" placeholder="请选择时间" autocomplete="off">
                </div>
            </div>
            <div class="row cl pd-10" id="customer" style="display: none">
                <div class="clearfix col-md-12 f-l" style="width:35%">
                    <label class="f-l pt-5 wd_140"><span class="c-red c-must">*</span>客户类型：</label>
                    <span class="select-box radius" style="width:30%">
                        <select class="select" size="1" name="custType" id="custType" onchange="getCustType(this)">
                            <option value="" selected>请选择客户类型</option>
                                    <!--<option value="11">签约客户(非分销)</option>
                                    <option value="12">签约客户(分销)</option>-->
                                    <option value="20">普通客户</option>
                                    <option value="30">认证客户</option>
                        </select>
                    </span>
                </div>
                <div class="clearfix">
                    <div class="clearfix col-md-12 f-l" style="width:35%">
                      <label class="f-l pt-5 wd_140"><span class="c-red c-must">*</span>发放客户：</label>
                      <div  class="formControls col-md-6 pos-r f-l" onblur="document.getElementById('custList').classList.add('hide')"  style="width:200px">
                        <input type="text" class="input-text radius" id="searchCust" name="searchCust"  placeholder="请输入客户名称关键字" autocomplete="off">
                        <div class="pos-a sel_mh hide custlist">
                            <ul id="custList">
                            </ul>
                        </div>
                    </div>
                  </div>
                  <div class="col-md-3 pt-5"><a class="mr-15" onclick="upLoadFile()">导入客户</a>
                      <input id="fileUp" type="file" onchange="putDataToPage()" style="display: none">&nbsp;
                      <!--<a id="download"><u>签约会员模版</u>&nbsp;&nbsp;</a>&nbsp;-->
                      <a id="download2"><u>普通会员模版</u>&nbsp;&nbsp;</a></div>
                </div>
                <!--<div class="row cl ml-50">
                    <div class="col-md-5 ml-20 pd-20">
                      <label class="form-label f-l  wd_140">客户名称：</label>
                      <div  class="formControls col-md-6"><input type="text" class="input-text radius" name=""  placeholder="输入名称关键字"></div>
                      <input class="btn btn-primary radius" type="button" value="查询">
                    </div>
                </div>-->

                <div class="row cl ml-50" style="width:60%">
                    <table id="datatable" class="table table-border table-bordered table-hover table-sort table-bg mt-20" style="width:80%;margin-left:95px;">
                    <thead>
                      <tr class="text-c">
                        <th width="100">客户ID</th>
                          <th width="90">客户类型</th>
                        <th width="200">客户名称</th>
                        <th width="90">所在城市</th>
                        <!--<th width="100">注册时间</th>                                          -->
                        <th width="100">操作</th>
                      </tr>
                    </thead>
                        <tbody class="shun">
                        </tbody>
                  </table>

                </div>
                <!-- <div class="row cl pd-20" style="margin-left: 70px">
                    <div class="text-r pagination wd_700 ml-50">
                        <a href="javascript:;" class="page active">1</a>
                        <a href="javascript:;" class="page">2</a>
                        <a href="javascript:;" class="page">3</a>
                        <a href="javascript:;" class="page">4</a>
                        <a href="javascript:;" class="page">5</a>
                        <a href="javascript:;" class="page">…</a>
                        <a href="javascript:;" class="page">250</a>

                        <a href="javascript:;" class="next_btn"></a>
                        <span>跳转至第 <input type="text" class="input-text radius page_text" name=""  placeholder="">页</span>

                        <input class="btn btn-primary radius ml-10" type="button" value="确定">
                    </div>
                 </div>-->
                                
            </div>

             <div class="row cl pd-10">
                <div class="clearfix">
                    <div class="col-md-4">
                      <label class="form-label f-l wd_140 pt-5"><span class="c-red c-must">*</span>选择电子券主题：</label>
                      <div  class="formControls col-md-6 pos-r">
                        <input type="text" class="input-text radius" id="searchCoupon" name="searchCoupon"  placeholder="输入电子券主题编号/名称关键字" autocomplete="off">
                        <div class="pos-a sel_mh hide couponlist" >
                            <ul id="couponList">
                            </ul>
                        </div>
                    </div>
                  </div>                                 
                </div>              

                <div class="row cl pd-20 ml-50" id="topic-1" style="display: none">
                    <table id="datatable1" class="table table-border table-bordered table-hover table-sort table-bg" style="width:90%;margin-left:75px;">
                    <thead>
                      <tr class="text-c">                      
                        <th width="100">券类型</th>
                        <th width="120">电子券主题编号</th>
                        <th width="120">电子券主题名称</th>
                        <th width="90">面额</th>
                        <th width="150">有效期</th>                                          
                        <!--<th width="100">状态</th>-->
                        <th width="100">剩余数量</th>
                        <th width="100">发放数量</th>
                        <th width="100">操作</th>
                      </tr>
                    </thead>
                    <tbody class="shun">
                    </tbody>
                  </table>
                </div>
                 <div class="row cl pd-20 ml-50" id="topic-2" style="display: none">
                     <table id="datatable2" class="table table-border table-bordered table-hover table-sort table-bg"
                            style="width:90%;margin-left:75px;">
                         <thead>
                         <tr class="text-c">
                             <th width="100">券类型</th>
                             <th width="120">电子券主题编号</th>
                             <th width="120">电子券主题名称</th>
                             <th width="90">面额</th>
                             <th width="150">有效期</th>
                             <!--<th width="100">状态</th>-->
                             <th width="100">剩余数量</th>
                             <th width="100">单次发放数量</th>
                             <th width="100">总发放数量</th>
                             <th width="100">操作</th>
                         </tr>
                         </thead>
                         <tbody class="shun" id="productList">
                         </tbody>
                     </table>
                 </div>
             </div>
            <div class="text-c mb-10 ">
          <input id="bottm" type="submit" class="btn btn-secondary radius size-S botter " value="&nbsp;确&nbsp;&nbsp;认&nbsp;">
                <!--<input id="test" type="button" class="btn btn-secondary radius size-S botter " value="&nbsp;测&nbsp;&nbsp;认&nbsp;" >-->

            </div>
        </div> 
        </div>

        </div>
    </form>
    <div id="beijing"></div>
    <img id="myLoading" src="../../img/load.gif"/>
</section>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../ht-js/verifyToken.js?rev=@@hash"></script>
<!--<script src="../../ht-js/Project.js?rev=@@hash"></script>-->
<script src="../../ht-js/coupon/coupon-datatable.js?rev=@@hash"></script>
<script src="../../ht-js/dynamicWarehouse.js?rev=@@hash"></script>
<script>
    var loginData = JSON.parse(decodeURIComponent(web.readCookie("loginData")));
    $(function () {
        $('#sendCouponUser').html(loginData.user.name);
        $('#sendCouponDept').html(loginData.department.department_NAME);
    });
    $('#download').attr('href',root.couponInter.coupon_downloadUserExcelTemplate)
	$('#download2').attr('href',root.couponInter.coupon_downloadGeneralUserExcelTemplate)
</script>
</body>
</html>